package com.kaili.common.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 员工表,可用于PDA登陆
 */
@ExcelTarget("BaseEmployee")
public class BaseEmployee implements LoginDetail,Serializable {
    private static final long serialVersionUID = 1366272236539679950L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @Excel(name = "备注", orderNum = "14")
    private String remark;
    private Long createBy;
    private Long modifyBy;
    @Excel(name = "创建时间", orderNum = "7",format = "yyyy-MM-dd HH:mm")
    private Date createTime;
    private Date modifyTime;
    @Excel(name = "用户编号", orderNum = "2")
    private String employeeCode;
    @Excel(name = "用户名", orderNum = "1")
    private String employeeName;
    @Excel(name = "真名", orderNum = "3")
    private String employeeRealName;
    private Integer siteId;
    //部门ID,就是网点ID因为仓储系统中没有网点的概念
    private Integer deptId;
    @Excel(name = "手机", orderNum = "5")
    private String phone;
    @Excel(name = "固定电话", orderNum = "6")
    private String landPhone;
    @JSONField(serialize=false)
    private String password;
    private Integer sex;
    @Excel(name = "邮箱", orderNum = "4")
    private String mail;
    @Excel(name = "登录次数", orderNum = "8")
    private Integer loadTimes;
    private Date inTime;
    private String address;
    private Integer isDriver;
    private Integer isPda;
    private String code;
    private String type;
    private Integer page;
    private Integer pageSize;
    private String siteName;
    @Excel(name = "部门", orderNum = "9")
    private String deptName;
    private Integer rid;
    private Integer employeeType;
    @Excel(name = "类型", orderNum = "11")
    private String employeeTypeName;
    private Integer shipper;
    @Excel(name = "货主", orderNum = "12")
    private String shipperName;
    private Integer depot;
    @Excel(name = "仓库", orderNum = "13")
    private String depotName;
    @Excel(name = "角色", orderNum = "10")
    private String rName;
    private String createdName;
    private String pinyin;
    private String companyName;
    private Integer unlock;

    private String siteCode;

    private Integer companyId;


    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getSiteCode() {
        return siteCode;
    }

    @Override
    public void setSiteCode(String siteCode) {
        this.siteCode = siteCode;
    }

    public Integer getUnlock() {
        return unlock;
    }

    public void setUnlock(Integer unlock) {
        this.unlock = unlock;
    }
    public String getCode() {
        return code;
    }

    @Override
    public void setCode(String code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    @Override
    public void setType(String type) {
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(Long modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getEmployeeCode() {
        return employeeCode;
    }

    public void setEmployeeCode(String employeeCode) {
        this.employeeCode = employeeCode;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public Integer getSiteId() {
        return siteId;
    }

    public void setSiteId(Integer siteId) {
        this.siteId = siteId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @JSONField(serialize=false)
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        List<GrantedAuthority> authorities = new ArrayList<>();
        authorities.add(new SimpleGrantedAuthority("ROLE_visitor"));
        return authorities;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @JSONField(serialize=false)
    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @JSONField(serialize=false)
    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @JSONField(serialize=false)
    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getInTime() {
        return inTime;
    }

    public void setInTime(Date inTime) {
        this.inTime = inTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getIsDriver() {
        return isDriver;
    }

    public void setIsDriver(Integer isDriver) {
        this.isDriver = isDriver;
    }

    public Integer getIsPda() {
        return isPda;
    }

    public void setIsPda(Integer isPda) {
        this.isPda = isPda;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    @Override
    public void setName(String name) {

    }

    public Integer getRid() {
        return rid;
    }

    public void setRid(Integer rid) {
        this.rid = rid;
    }

    public String getrName() {
        return rName;
    }

    public void setrName(String rName) {
        this.rName = rName;
    }

    public String getCreatedName() {
        return createdName;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getEmployeeRealName() {
        return employeeRealName;
    }

    public void setEmployeeRealName(String employeeRealName) {
        this.employeeRealName = employeeRealName;
    }

    public String getLandPhone() {
        return landPhone;
    }

    public void setLandPhone(String landPhone) {
        this.landPhone = landPhone;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public Integer getLoadTimes() {
        return loadTimes;
    }

    public void setLoadTimes(Integer loadTimes) {
        this.loadTimes = loadTimes;
    }

    public Integer getEmployeeType() {
        return employeeType;
    }

    public void setEmployeeType(Integer employeeType) {
        this.employeeType = employeeType;
    }

    public Integer getShipper() {
        return shipper;
    }

    public void setShipper(Integer shipper) {
        this.shipper = shipper;
    }

    public Integer getDepot() {
        return depot;
    }

    public void setDepot(Integer depot) {
        this.depot = depot;
    }

    public String getEmployeeTypeName() {
        return employeeTypeName;
    }

    public void setEmployeeTypeName(String employeeTypeName) {
        this.employeeTypeName = employeeTypeName;
    }

    public String getShipperName() {
        return shipperName;
    }

    public void setShipperName(String shipperName) {
        this.shipperName = shipperName;
    }

    public String getDepotName() {
        return depotName;
    }

    public void setDepotName(String depotName) {
        this.depotName = depotName;
    }
}
